package com.weighing.system.mapper.server;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.weighing.system.domain.server.WeighingMaster;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WeighingMasterMapper extends BaseMapper<WeighingMaster> {

    /**
     * 根据工单号查询主表及其明细
     */
    WeighingMaster selectByBillNo(@Param("billNo") String billNo);

    /**
     * 根据来源工单号查询主表及其明细(未完成)
     */
    List<WeighingMaster> selectByFromBillNo(@Param("fromBillNo") String fromBillNo);

    /**
     * 根据来源工单号查询主表及其明细(已完成)
     */
    List<WeighingMaster> selectByFromBillNoFinished(@Param("fromBillNo") String fromBillNo);

    /**
     * 根据单据号获取称重单信息
     * @param billNo 单据号
     * @return 称重单信息
     */
    WeighingMaster getWeighingMasterByBillNo(@Param("billNo") String billNo);

    /**
     * 根据单据号获取下料单信息
     * @param billNo 单据号
     * @return 称重单信息
     */
    WeighingMaster getWeighingMaster006ByBillNo(@Param("billNo") String billNo);

}
